import request from "@/utils/request";

export const loginApi = (param) => {
  return request.post("/app/user/login/mini", param);
};

// 查询我的余额
export const queryBalance = () => {
  return request.get("/app/pay/balance/info");
};

// 充值余额
export const rechargeBalance = (param) => {
  return request.post("/app/pay/order/recharge", param);
};

// 充值流量
export const rechargeTraffic = (param) => {
  return request.post("/app/pay/order/traffic", param);
};

// 充值短信
export const rechargeSms = (param) => {
  return request.post("/app/pay/order/sms", param);
};

// 充值电话通知
export const rechargePhone = (param) => {
  return request.post("/app/pay/order/call", param);
};

// 充值记录
export const queryRechargeRecord = (param) => {
  return request.get("/app/pay/order/list", param);
};

// 获取余额变动
export const queryBalanceChange = (param) => {
  return request.get("/app/pay/balance/logs", param);
};

// 获取帮助中心
export const queryHelp = (param) => {
  return request.get("/app/help/info/helpCenter", param);
};

// 获取隐私条款
export const queryPrivacy = (param) => {
  return request.get("/app/help/info/privacyPolicy", param);
};

// 关于我们
export const queryAbout = (param) => {
  return request.get("/app/help/info/aboutUs", param);
};

// 用户绑定设备
export const bindDevice = (param) => {
  return request.post("/app/device/device/bind", param);
};

// 获取当前用户绑定的设备
export const queryBindDevice = (param) => {
  return request.post("/app/device/device/getBindDevice", param, {
    isPrompt: false,
  });
};

// 想设备发送指令
export const sendCommand = (param) => {
  return request.post("/app/device/device/sendCommand", param, {
    load: false,
  });
};

// 通过设备ID查询设备详细信息
export const queryDeviceById = (param) => {
  return request.post("/app/device/device/getDeviceInfo", param);
};

// 设置设备预警配置
export const setDeviceWarning = (param) => {
  return request.post("/app/device/device/setAlertConfig", param);
};

// 获取预警配置
export const getDeviceWarning = (param) => {
  return request.post("/app/device/device/getAlertConfig", param);
};

// 测试微信支付/app/pay/order/recharge
export const testWxPay = (param) => {
  return request.post("/app/pay/order/testPay", param);
};

// 获取用户信息
export const getUserInfo = (param) => {
  return request.get("/app/user/info/person", param, {
    isPrompt: false,
  });
};

// 查询用户余额
export const getUserBalance = (param) => {
  return request.get("/app/user/balance/get", param);
};

// 发送短信
export const sendSms = (param) => {
  return request.post("/app/device/device/sendSms", param);
};

// 获取天气
export const getWeather = (param) => {
  return request.post("/app/device/device/getDeviceWeather", param);
};

// 添加代理
export const addAgent = (param) => {
  return request.post("/app/user/info/addDealer", param);
};
